/*
 * AddAddressListItem.java
 * business
 *
 * Created by ChenTao on 2017/5/23.
 *
 * Copyright (c) 2017年 yidiandao. All rights reserved.
 */

package com.yidiandao.business.ui.widget.listview.displaylistitem;

import android.app.Activity;
import android.content.Context;
import android.view.View;

import com.yidiandao.business.R;
import com.yidiandao.business.data.address.Area;
import com.yidiandao.business.ui.addressabout.addaddress.AddAddressActivity;
import com.yidiandao.business.ui.widget.listview.DisplayListItem;
import com.yidiandao.business.ui.widget.listview.viewholder.ChooseAddressAddHolder;
import com.yidiandao.business.utils.UmengUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * 地址管理-添加地址
 * <p>
 * Created by ChenTao(chentao7v@gmail.com) on 2017/5/23 0023 15:15
 */
public class AddAddressListItem extends DisplayListItem<ChooseAddressAddHolder, List<Area>> implements View.OnClickListener {

    private Activity mActivity;

    public AddAddressListItem(List<Area> areas) {
        super(areas);
    }

    @Override
    public void onShow(Context context, ChooseAddressAddHolder holder) {
        mActivity = (Activity) context;
        holder.mRlytAdd.setOnClickListener(this);
    }

    @Override
    public String getDisplayItemTag() {
        return AddAddressListItem.class.getSimpleName();
    }

    @Override
    public Class<ChooseAddressAddHolder> getViewHolderClazz() {
        return ChooseAddressAddHolder.class;
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.rlyt_add:
                UmengUtils.onEvent(mActivity, R.string.umeng_user_add_address);
                AddAddressActivity.actionStart(mActivity, (ArrayList<Area>) data);
                break;
        }
    }
}
